package com.lrkj.payfee.mapper;

import java.math.BigDecimal;
import java.util.List;
import com.lrkj.payfee.domain.AdvanceReceipt;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 预收单Mapper接口
 *
 * @author yajun_ren
 * @date 2021-08-06
 */
@Component
public interface AdvanceReceiptMapper
{
    /**
     * 查询预收单
     *
     * @param madvanceReceiptId 预收单ID
     * @return 预收单
     */
    public AdvanceReceipt selectAdvanceReceiptById(String madvanceReceiptId);

    /**
     * 查询预收单列表
     *
     * @param advanceReceipt 预收单
     * @return 预收单集合
     */
    public List<AdvanceReceipt> selectAdvanceReceiptList(AdvanceReceipt advanceReceipt);

    /**
     * 新增预收单
     *
     * @param advanceReceipt 预收单
     * @return 结果
     */
    public int insertAdvanceReceipt(AdvanceReceipt advanceReceipt);

    /**
     * 修改预收单
     *
     * @param advanceReceipt 预收单
     * @return 结果
     */
    public int updateAdvanceReceipt(AdvanceReceipt advanceReceipt);

    /**
     * 删除预收单
     *
     * @param madvanceReceiptId 预收单ID
     * @return 结果
     */
    public int deleteAdvanceReceiptById(String madvanceReceiptId);

    /**
     * 批量删除预收单
     *
     * @param madvanceReceiptIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteAdvanceReceiptByIds(String[] madvanceReceiptIds);

    public int updateByBatch(@Param("updateBeans") List<AdvanceReceipt> updateBeans);


    /**
     * 通过房屋IDS 获取预收金额
     *
     * **/
    public BigDecimal getAdvanceMoney(String rommIds);

    //通过业主查询预收款余额
    public BigDecimal getAmountRemaining(AdvanceReceipt advanceReceipt);


    /**
     * 根据业务ID批量删除预收单
     *
     * @param businessIds 需要删除的业务IDS
     * @return 结果
     */
    public int deleteByBusinessIds(String[] businessIds);

}
